.nut-theme-dark {
  .nut-collapse-item {
    .nut-collapse-item__title {
      color: $dark-color;
      background: $dark-background;
      box-shadow: none;
    }

    .nut-collapse-item__title--disabled {
      color: $dark-color-gray;

      .collapse-icon {
        color: $dark-color-gray;
      }
    }

    // stylelint-disable selector-class-pattern

    .nut-collapse__item-wrapper {
      .collapse-content,
      .nut-collapse__item-wrapper__content,
      .nut-collapse__item-extraWrapper__extraRender {
        color: $dark-color;
        background: $dark-background2;
      }
    }

    .nut-collapse__item-extraWrapper {
      .nut-collapse__item-extraWrapper__extraRender,
      .nut-collapse__item-wrapper__content {
        background: $dark-background2;
      }
    }

    // stylelint-enable selector-class-pattern
  }
}

.nut-collapse-item__border {
  .nut-collapse-item__title {
    &::after {
      position: absolute;
      right: 16px;
      bottom: 0;
      left: 16px;
      box-sizing: border-box;
      pointer-events: none;
      content: "";
      border-bottom: 1px solid #ebedf0;
      transform: scaleY(0.5);
    }
  }
}

.nut-collapse-item {
  position: relative;

  .nut-collapse-item__title {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: $collapse-item-padding;
    overflow: hidden;
    font-size: $collapse-item-font-size;
    line-height: $collapse-item-line-height;
    color: $collapse-item-color;
    background-color: #fff;

    .nut-collapse-item__title-main {
      flex: 1;
    }

    .nut-collapse-item__title-main-value {
      display: block;

      .nut-collapse-item__title-main-icon {
        top: 2px;
      }
    }

    .nut-collapse-item__title-icon {
      // display: block;
      // position: absolute;
      // top: 50%;
      // right: 16px;
      display: flex;
      align-items: center;
      color: $collapse-item-icon-color;
      transition: transform 0.3s;

      &--expanded {
        transform: rotate(-180deg);
      }
    }

    .nut-collapse-item__title-sub {
      position: absolute;
      top: 50%;
      right: 65px;
      margin-top: -12px;
      color: $collapse-item-sub-title-color;
    }

    .nut-collapse-item__title-label {
      display: block;
      font-size: 12px;
      color: #969799;
    }
  }

  // stylelint-disable selector-class-pattern

  .nut-collapse__item-wrapper,
  .nut-collapse__item-extraWrapper {
    position: relative;
    display: block;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;

    .nut-collapse__item-wrapper__content,
    .nut-collapse__item-extraWrapper__extraRender {
      display: block;
      padding: $collapse-wrapper-content-padding;
      font-size: $collapse-wrapper-content-font-size;
      line-height: $collapse-wrapper-content-line-height;
      color: $collapse-wrapper-content-color;
      background-color: $collapse-wrapper-content-background-color;
    }

    .nut-collapse__item-wrapper__content--empty {
      padding: $collapse-wrapper-empty-content-padding;
    }
  }

  .nut-collapse__item-extraWrapper {
    height: auto;

    .nut-collapse__item-extraWrapper__extraRender {
      overflow: hidden;
      word-break: break-all;
      word-wrap: break-word;
    }
  }

  // stylelint-enable selector-class-pattern

  .open-style {
    height: auto;
    will-change: height;
  }

  .close-style {
    will-change: auto;
  }

  .nut-collapse-item__title--disabled {
    color: $collapse-item-disabled-color;
    pointer-events: none;
    cursor: not-allowed;

    .collapse-icon {
      color: $collapse-item-disabled-color;
    }
  }

  .nut-collapse-item__title-mtitle {
    display: inline-block;
  }
}

.collapse-border-none {
  .nut-collapse-item__title {
    &::after {
      display: none;
    }
  }
}
